# -*- coding=utf-8-*-
"""
@File:memory_selection
@Author:Created by Han X.Y
@Date:on 2021/7/12 18:51 
"""
"""
给定两个字符串 s 和 t ，编写一个函数来判断 t 是否是 s 的字母异位词。

输入: s = "anagram", t = "nagaram"
输出: true

输入: s = "rat", t = "car"
输出: false


"""

class Solution:
    def isAnagram(self, s, t) :
        s="".join(sorted(list(s)))
        t="".join(sorted(list(t)))
        return True if s==t else False

if __name__=="__main__":
    s=Solution()
    S=["anagram","rat"]
    T=[ "nagaram","car"]
    for i,j in zip(S,T):
        print(s.isAnagram(i,j))